With a power transistor that performs high-speed switching operation, a surge voltage may be generated due to a parasitic inductance when the power transistor is turned off. The generation of the surge voltage is disadvantageous, since the surge voltage may cause breakdown of a gate insulating film and/or ringing in a circuit. Since the surge voltage is high and is generated for a short time period, detection of the surge voltage is difficult.